From 63dfc9b54156880d32389cd841b3e6c77054cc31 Mon Sep 17 00:00:00 2001 From: Michael Schumacher Date: Thu, 1 Sep 2005 22:11:45 +0000 Subject: [PATCH] added a check for OS_WIN32 link with libgw32c to provide dl* functions on 2005-09-01 Michael Schumacher * configure.ac: added a check for OS_WIN32 * babl/Makefile.am: link with libgw32c to provide dl* functions on win32 * babl/babl-extension.c: added definitions of dl* function forwin32 * tests/Makefile.am: removed -ldl for win32 --- ChangeLog | 8 +++++ babl/Makefile.am | 11 +++++-- babl/babl-extension.c | 9 +++++- configure.ac | 72 +++++++++++++++++++++++++++++++++++++++++++ tests/Makefile.am | 8 ++++- 5 files changed, 104 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4191e1a..26e7e03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-09-01 Michael Schumacher + + * configure.ac: added a check for OS_WIN32 + * babl/Makefile.am: link with libgw32c to provide dl* functions on + win32 + * babl/babl-extension.c: added definitions of dl* function forwin32 + * tests/Makefile.am: removed -ldl for win32 + 2005-09-01 Sven Neumann * tests/Makefile.am (TESTS_ENVIRONMENT): set BABL_PATH to include diff --git a/babl/Makefile.am b/babl/Makefile.am index 469a4a3..2ca82e7 100644 --- a/babl/Makefile.am +++ b/babl/Makefile.am @@ -1,5 +1,10 @@ ## Source directory +if OS_WIN32 +win32_libs = -lgw32c -lole32 -luuid -lwsock32 +no_undefined = -no-undefined +endif + SUBDIRS = base c_sources = \ @@ -39,11 +44,13 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/babl/base lib_LTLIBRARIES= libbabl.la libbabl_la_SOURCES= $(h_sources) $(c_sources) libbabl_la_LIBADD=\ - base/libbase.la + base/libbase.la \ + ${win32_libs} libbabl_la_LDFLAGS= \ -version-info $(BABL_LIBRARY_VERSION) \ - -release $(BABL_RELEASE) + -release $(BABL_RELEASE) \ + ${no_undefined} EXTRA_DIST := \ .cvsignore diff --git a/babl/babl-extension.c b/babl/babl-extension.c index 30164a0..9fbac8a 100644 --- a/babl/babl-extension.c +++ b/babl/babl-extension.c @@ -44,7 +44,6 @@ #include #include - static int each_babl_extension_destroy (Babl *babl, void *data); static Babl *babl_extension_current_extender = NULL; @@ -139,7 +138,15 @@ destroy_hook (void) #include #include +#ifndef OS_WIN32 #include +#else +void *dlopen(const char *, int); +void *dlsym(void *, const char *); +int dlclose(void *); +char *dlerror(void); +#endif + #ifndef RTLD_NOW #define RTLD_NOW 0 #endif diff --git a/configure.ac b/configure.ac index e0e3b39..bd7d3aa 100644 --- a/configure.ac +++ b/configure.ac @@ -52,6 +52,78 @@ AM_CONDITIONAL(HAVE_INKSCAPE, test "x$INKSCAPE" != "xno") AC_PATH_PROG(W3M, w3m, no) AM_CONDITIONAL(HAVE_W3M, test "x$W3M" != "xno") +########################### +# Check target architecture +########################### + +AC_MSG_CHECKING([for target architecture]) +case x"$target" in + xNONE | x) + target_or_host="$host" ;; + *) + target_or_host="$target" ;; +esac +AC_MSG_RESULT([$target_or_host]) + +case "$target_or_host" in + i*86-*-*) + have_x86=yes + AC_DEFINE(ARCH_X86, 1, [Define to 1 if you are compiling for ix86.]) + ;; + x86_64-*-*) + have_x86=yes + AC_DEFINE(ARCH_X86, 1, [Define to 1 if you are compiling for ix86.]) + AC_DEFINE(ARCH_X86_64, 1, [Define to 1 if you are compiling for amd64.]) + ;; + ppc-*-* | powerpc-*) + have_ppc=yes + AC_DEFINE(ARCH_PPC, 1, [Define to 1 if you are compiling for PowerPC.]) + ;; + ppc64-*-* | powerpc64-*) + have_ppc=yes + AC_DEFINE(ARCH_PPC, 1, [Define to 1 if you are compiling for PowerPC.]) + AC_DEFINE(ARCH_PPC64, 1, [Define to 1 if you are compiling for PowerPC64.]) + ;; + *) + ;; +esac + + +################# +# Check for Win32 +################# + +AC_MSG_CHECKING([for some Win32 platform]) +case "$target_or_host" in + *-*-mingw* | *-*-cygwin*) + platform_win32=yes + ;; + *) + platform_win32=no + ;; +esac +AC_MSG_RESULT([$platform_win32]) +AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes") + +AC_MSG_CHECKING([for native Win32]) +case "$target_or_host" in + *-*-mingw*) + os_win32=yes + PATHSEP=';' + ;; + *) + os_win32=no + PATHSEP=':' + ;; +esac +AC_MSG_RESULT([$os_win32]) +AC_SUBST(PATHSEP) + +AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes") +AC_DEFINE(OS_WIN32, 1, "Define to 1 if you are compiling for Microsoft Windows.") + +AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes") + dnl =========================================================================== AC_DEFINE_UNQUOTED(BABL_PATH, "~/.babl-$BABL_API_VERSION:/usr/local/lib/babl-$BABL_API_VERSION:/usr/lib/babl-$BABL_API_VERSION", [search path for babl extensions (default value of enviroment variable)]) diff --git a/tests/Makefile.am b/tests/Makefile.am index 4f631a8..71b7509 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,3 +1,8 @@ +if OS_WIN32 +else +dl = -ldl +endif + TESTS = \ grayscale_to_rgb \ rgb_to_bgr \ @@ -21,7 +26,8 @@ models_SOURCES = models.c AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/babl -LDADD = $(top_builddir)/babl/libbabl.la -lm -ldl + +LDADD = $(top_builddir)/babl/libbabl.la -lm ${dl} noinst_PROGRAMS = \ introspect \ -- 2.30.2